package com.correo.database.beans;

import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;

import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.JTextField;

import com.correo.vista.server.windows.ventanasInternas.ComboTablas;

public class CasillaCorreoBean implements IBean{

    
	private String id;
	

    private Set<OfficeBean> listaOffice;

    private UserBean user;

    public CasillaCorreoBean () {
    	listaOffice = new LinkedHashSet<OfficeBean>();
    }
    
    public CasillaCorreoBean(String id)
    {
    	this.id = id;
    }

    @Override
    public String toString(){
    	return id;
    }
    public Set<OfficeBean> getListaOffice () {
        return listaOffice;
    }

    public void setListaOffice (Set<OfficeBean> val) {
        this.listaOffice = val;
    }
    public UserBean getUser () {
        return user;
    }

    public void setUser (UserBean val) {
        this.user = val;
    }
  
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public ComboTablas getCombo() {
		ComboTablas combo=new ComboTablas();
		if(listaOffice!=null){
			Iterator<OfficeBean> it=listaOffice.iterator();

			while(it.hasNext()){
				((DefaultComboBoxModel)combo.getModel()).addElement(it.next());
			}
		}
		return combo;
	}

}

